package com.xoa.controller.party;

import com.xoa.model.party.FourForm;
import com.xoa.model.party.FourFormWithBLOBs;
import com.xoa.service.party.FourFormService;
import com.xoa.util.ToJson;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * Created by gsb on 2017/11/25.
 */
@Controller
@RequestMapping("/fourForm")
public class FourFormController {
    @Resource
    private FourFormService fourFormService;


    @RequestMapping("/insert")
    @ResponseBody
    public ToJson<FourForm> insert(String beginTime, String tbr, String lxdh, String tbsj , FourFormWithBLOBs fourForm, HttpServletRequest request){
        return fourFormService.insert(beginTime, tbr, lxdh, tbsj, fourForm);

    }
    @RequestMapping("/update")
    @ResponseBody
    public ToJson<FourForm> update(String beginTime, String tbr, String lxdh, String tbsj , FourFormWithBLOBs fourForm, HttpServletRequest request){
        return fourFormService.update(beginTime,tbr, lxdh, tbsj,fourForm);
    }

    @RequestMapping("/deleteByPrimaryKey")
    @ResponseBody
    public ToJson<FourForm> deleteByPrimaryKey(Integer sid, HttpServletRequest request){
        return fourFormService.deleteByPrimaryKey(sid);
    }

    @RequestMapping("/selectByPrimaryKey")
    @ResponseBody
    public ToJson<FourForm> selectByPrimaryKey(Integer sid, HttpServletRequest request){
        return fourFormService.selectByPrimaryKey(sid);
    }


    @RequestMapping("/query")
    @ResponseBody
    public ToJson<FourFormWithBLOBs> query(Map<String,Object> maps, Integer page,
                                           Integer pageSize, boolean useFlag, HttpServletRequest request){
        return fourFormService.query(maps, page, pageSize, useFlag);
    }
}
